function update_yahoo_data(ticker_list, startDate, endDate, data_path, period)
% want to call yahoo data and output results to flat files in [wcm_root]\data\yahoo_data
% this is the wrapper

if nargin < 5, period = 'd'; end
if nargin < 4, data_path = [getenv('wcm_root') 'data/yahoo_data/']; end
if nargin < 3, endDate = datestr(today(),'mm/dd/yyyy'); end
if nargin < 2, startDate = '12/10/2014'; end
if nargin < 1
  update = yes_or_no(['Update all yahoo data in ',data_path ,' since ',startDate,'?']);
  if update
    ret = readTS(data_path,'all_ret.csv');
    ticker_list = ret.header;
  else
    return
  end
end

% starts loading data at a particular ticker. set first missing to 1 to load all data
first_missing = 1;
for i = 1:length(ticker_list)
  if first_missing
    temp = getYahooData(ticker_list{i},startDate, endDate, data_path, period);
  else
    if strcmp(ticker_list{i},'PWZ')
      first_missing = 1;
      disp(i)
      temp = getYahooData(ticker_list{i},startDate, endDate, data_path, period);
  end    
end

end